package com.hpsk.utils;

import cn.hutool.http.HttpRequest;

import java.util.Map;

/**
 * @author huangwang2832511019
 */
public class HttpsUtils {

    public static Object get(String url, Map<String,Object> mapParams){
        return HttpRequest.get(url)
                .header("Token", CommonServletUtil.getParamFromRequest("Token"))
                .contentType("application/json")
                .form(mapParams)
                .timeout(20000)
                .execute().body();
    }

    public static Object post(String url, Map<String,Object> mapParams){
        return HttpRequest.post(url)
                .header("Token", CommonServletUtil.getParamFromRequest("Token"))
                .contentType("application/json")
                .form(mapParams)
                .timeout(20000)
                .execute().body();
    }
}
